create or replace view vac_application_authorization as
with author AS
(
select
 workspace,
 application_id,
 application_name,
 authorization_scheme_name,
 scheme_type,
 scheme,
 scheme_text,
 error_message,
 caching,
 is_subscribed,
 last_updated_by,
 last_updated_on,
 component_comment,
 authorization_scheme_id,
 referenced_scheme_id,
 component_signature
from APEX_APPLICATION_AUTHORIZATION t
)
select
 workspace,
 application_id,
 application_name,
 authorization_scheme_name,
 authorization_scheme_id,
 referenced_scheme_id,
 last_updated_by,
 last_updated_on,
 'APEX_APPLICATION_AUTHORIZATION' src_view_name,
 u_name,
 u_value
from author
 UNPIVOT INCLUDE NULLS
  (u_value FOR u_name IN
     ( scheme_type,
       scheme,
       scheme_text,
       error_message,
       caching,
       is_subscribed,
       component_comment
     )
  );

